@include('admin.header')
<style>
form{

	
}
label{
	line-height:40px;
}
label span{
	display: inline-block;
	width: 150px;
	text-align: right;
}
input[type="submit"]{
	position: absolute;
	right: 20px;
	bottom: 20px;
	margin-left: 20px;
	display: inline-block;
	text-align: right;
}




</style>
</head>
<body>
	<div class="wrap js-check-wrap">

		<form  method="post" class="js-ajax-tree js-category-add">
			<div>
			   <label>
				<span>转账流水号：</span>
				<input type="text" style="width: 200px;height: 40px;" name="transfer_id" readonly="readonly" value="{{$transfer_id or ''}}"/>
				</label>

				<label>
				<span>退款备注：</span>
				<textarea name="remarks" style="width: 250px;height: 70px;"></textarea>
				
				</label>
				<input type="hidden" name="transfer_id" value="{{$transfer_id or ''}}"/>
				<input type="submit" class="btn btn-primary" value="提交" />
				
			</div>
		</form>
	</div>
	<script type="text/javascript" src="/static/js/common.js"></script>
	<script type="text/javascript" src="/static/js/validate/validate.js"></script>
	<script type="text/javascript" src="/static/js/layer/layer.js"></script>
	<script type="text/javascript">
			$(function() {
			$(".js-category-add").validate({
				rules: {
				 	freezevalue : {
		                required    : true,
		                number      : true,
		                min         : 0.01,
		                max         : 9999999
		            },
					
				},
				messages: {
					freezevalue: {
						required: "请填写0.01~9999999之间的数字"
					}
				},
				submitHandler: function () {
					$.post("/capital/{{$action}}",$('.js-category-add').serialize(), function (msg) {
						if (msg.status == 1) {
							layer.confirm(msg.info, {
								btn: ['确定']
							}, function(){
								@if($action == 'water_off')
							    window.parent.location.reload();
	                            var index = parent.layer.getFrameIndex(window.name);
	                            parent.layer.close(index);
								@else
									window.location.href="{{asset('capital/capital_flow')}}";
								@endif
							});
						} else {
							showMsg(msg.info);
						}
					}, 'json');
					return false;
				}
			});
		});
		/**
		 * layer提示
		 */
		function showMsg(msg){
			layer.alert(msg, {
				title: '提示',
				icon: 2,
			});
		}
	</script>
</body>
</html>